package com.yang.dao;

import com.yang.entity.ElMenu;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author yangdacheng
 * @title: ElMenuDao 菜单栏控制层
 * @projectName note_api
 * @description: TODO
 * @date 2022/3/8 10:44 上午
 */
@Mapper
public interface ElMenuDao {

    /**
     * 获取所有的菜单栏
     * @return
     */
    @Select("SELECT * FROM elMenu")
    @Results(value = {
            @Result(column = "elMenuID",property = "elMenuID",id = true),
            @Result(column = "title",property = "title"),
            @Result(column = "iconClass",property = "iconClass"),
            @Result(column = "isDisableInt",property = "isDisable"),
    })
    List<ElMenu> queryAllEl();

    /**
     * 修改对应的信息
     * @param elMenu
     * @return
     */
    @Update("UPDATE elMenu SET title=#{title},iconClass=#{iconClass},isDisableInt=#{isDisable} WHERE " +
            "elMenuID = #{elMenuID}")
    Boolean updElMenu(ElMenu elMenu);
}
